import React, { useEffect, useState } from 'react';
import { Button } from 'dw-mx';
import { DateCell, DateToMoment , SelectCell ,EditcellTable} from 'dw-mx-table';
import Lov from '@/pages/table/Lov';
import { Code, Rule } from 'dw-mx-extend';
import classNames from 'classnames';

export default function EditcellTableDemo() {

    // const dataSource = [
    //     {
    //         key: '0',
    //         name: 'Edward King 0',
    //         age: 32,
    //         address: 'London, Park Lane no. 0',
    //         date: '2020/02/09',
    //         rwzt: '2',
    //         ywlx: ['1', '2', '3'],
    //         ksmc: 'search',
    //         dq: ['1', '2'],
    //         xb: '2',
    //     },
    //     {
    //         key: '1',
    //         name: 'Edward King 1',
    //         age: 32,
    //         address: 'London, Park Lane no. 1',
    //         date: '2020/08/09',
    //         rwzt: '2',
    //         ywlx: ['1', '2', '3'],
    //         ksmc: 'search',
    //         dq: ['2'],
    //         xb: '2',
    //     },
    // ]

    const dataSource = [
        {
            key: '0',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '1',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '2',
            name: 'Edward King 2',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
           ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '3',
            name: 'Edward King 3',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '4',
            name: 'Edward King 4',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '5',
            name: 'Edward King 5',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '6',
            name: 'Edward King 6',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '7',
            name: 'Edward King 7',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '8',
            name: 'Edward King 8',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '9',
            name: 'Edward King 9',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '10',
            name: 'Edward King 10',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '11',
            name: 'Edward King 11',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '12',
            name: 'Edward King 12',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '13',
            name: 'Edward King 13',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '14',
            name: 'Edward King 14',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '15',
            name: 'Edward King 15',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '16',
            name: 'Edward King 16',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '17',
            name: 'Edward King 17',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '18',
            name: 'Edward King 18',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '19',
            name: 'Edward King 19',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '20',
            name: 'Edward King 20',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '21',
            name: 'Edward King 21',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '22',
            name: 'Edward King 22',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '23',
            name: 'Edward King 23',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '24',
            name: 'Edward King 24',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '25',
            name: 'Edward King 25',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '26',
            name: 'Edward King 26',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '27',
            name: 'Edward King 27',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '28',
            name: 'Edward King 28',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '29',
            name: 'Edward King 29',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '30',
            name: 'Edward King 30',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '31',
            name: 'Edward King 31',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '32',
            name: 'Edward King 32',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '33',
            name: 'Edward King 33',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '34',
            name: 'Edward King 34',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '35',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '36',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '37',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '38',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '39',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '40',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '41',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '42',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '43',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '44',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '45',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '46',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '47',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '48',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '49',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '50',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '51',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '52',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '53',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '54',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '55',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '56',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '57',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '58',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '59',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '60',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '61',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '62',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '63',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '64',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '65',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '66',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '67',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '68',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '69',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '70',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '71',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '72',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '73',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '74',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '75',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '76',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '77',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '78',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '79',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '80',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '81',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '82',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '83',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '84',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '85',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '86',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '87',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '88',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '89',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '90',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '91',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '92',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '93',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '94',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '95',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '96',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '97',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '98',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '99',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '100',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '101',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '102',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '103',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '104',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '105',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '106',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '107',
            name: 'Edward King 1',
            age: 32,
            address: 'London, Park Lane no. 1',
            date: '2020/08/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['2'],
            xb: '2',
        },
        {
            key: '108',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },
        {
            key: '109',
            name: 'Edward King 0',
            age: 32,
            address: 'London, Park Lane no. 0',
            date: '2020/02/09',
            rwzt: '2',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['1', '2'],
            xb: '2',
        },

    ];

    const validateChinese = () =>{
        return ({ getFieldValue }) => ({
            validator(rule, value) {
                if (!value) {
                    return Promise.resolve();
                }
                if (!/^[\u4E00-\u9FA5]+$/.test(value)) {
                    return Promise.reject('只可以填中文，请检查！');
                }
                return Promise.resolve();
            },
        });
    }

    const inputnumber = classNames('input-number');
    const inputnumberfocused = classNames('input-number-focused')

    const columns = [
        {
            title: 'name',
            dataIndex: 'name',
            width: 100,
            editable: true,
            componentType: {
                type: 'Input',
                props: {
                    placeholder: '请输入' ,
                    bordered:false,
                    rule:validateChinese()
                },
            },
        },
        {
            title: 'age',
            dataIndex: 'age',
            width: 100,
            editable: true,
            componentType: {
                type: 'InputNumber',
                props: {
                    min: 1,
                    max: 100,
                    className:[inputnumber,inputnumberfocused],
                    style:{
                        border: 0,
                    },
                },
            },
        },
        {
            title: 'address',
            dataIndex: 'address',
            width: 200,
            editable: true,
            componentType: {
                type: 'Input.TextArea',
                props: {
                    autoSize: true,
                    bordered:false
                },
            },
        },
        {
            title: 'date',
            dataIndex: 'date',
            width: 150,
            editable: true,
            componentType: {
                type: 'DatePicker',
                props: {
                    format: 'YYYY/MM/DD',
                    bordered:false
                },
            },
            render: (value, record, index) => {
                return <DateCell value={value} mask={'YYYY/MM/DD'} />;
            },
        },
        {
            title: '任务状态',
            dataIndex: 'rwzt',
            width: 150,
            editable: true,
            componentType: {
                type: 'Select',
                props: {
                    options: Code.JSONCODE([
                        { value: '1', content: '已完成' },
                        { value: '2', content: '未完成' },
                        { value: '3', content: '已作废' },
                    ]),
                    allowClear: true,
                    bordered:false
                },
            },
            render: (value, record, index) => {
                return (
                    <SelectCell
                        value={value}
                        align={'left'}
                        options={Code.JSONCODE([
                            { value: '1', content: '已完成' },
                            { value: '2', content: '未完成' },
                            { value: '3', content: '已作废' },
                        ])}
                    />
                );
            },
        },
        {
            title: '业务类型',
            dataIndex: 'ywlx',
            width: 150,
            editable: true,
            componentType: {
                type: 'Select',
                props: {
                    options: Code.STRINGCODE('1:计划建立,2:待遇支付,3:缴费管理,4:交易处理,5:交易处理,6:匹配处理,7:计划管理,8:单位管理,9:人员管理,10:考核管理'),
                    allowClear: true,
                    mode: 'multiple',
                    bordered:false
                },
            },
            render: (value, record, index) => {
                return <SelectCell value={value} align={'left'} options={Code.STRINGCODE('1:计划建立,2:待遇支付,3:缴费管理,4:交易处理,5:交易处理,6:匹配处理,7:计划管理,8:单位管理,9:人员管理,10:考核管理')} />;
            },
        },
        {
            title: '搜索',
            dataIndex: 'ksmc',
            width: 100,
            editable: true,
            componentType: {
                type: 'Search',
                props: {
                    modalprops: {
                        searchmodal: Lov,
                        props: {},
                    },
                    searchprops: {
                        bordered:false
                    },
                },
            },
        },
        {
            title: '地区',
            dataIndex: 'dq',
            width: 100,
            editable: true,
            componentType: {
                type: 'Checkbox.Group',
                props: {
                    options: Code.STRINGCODE('1:北京,2:上海,3:深圳'),
                    onChange: (e) => console.log(e),
                    required: true,
                    message: '地区 是必填项',
                },
            },
        },
        {
            title: '性别',
            dataIndex: 'xb',
            width: 100,
            editable: true,
            componentType: {
                type: 'Radio.Group',
                props: {
                    options: Code.STRINGCODE('1:男,2:女'),
                    onChange: (e) => console.log(e),
                    required: true,
                    message: '性别是必填项',
                },
            },
        },
    ];

    const [data, setData] = useState(DateToMoment(dataSource, ['date'], 'YYYY/MM/DD'));

    const [selectedRowKeys, setSelectedRowKeys] = useState([]);

    const [count, setCount] = useState(2);

    useEffect(() => {
        setData(DateToMoment(data, ['date'], 'YYYY/MM/DD'));
    }, [data]);

    const rowSelection = {
        selectedRowKeys,
        onChange: (selectedRowKeys) => {
            setSelectedRowKeys(selectedRowKeys);
        },
    };

    const getTabledata = (tabledata) => {
        setData(tabledata);
    };

    //删除
    const handleDelete = () => {
        const tabledata = data;
        const result = tabledata.filter((item) => {
            if (selectedRowKeys.indexOf(item.key) == -1) {
                return item;
            }
        });
        setSelectedRowKeys([]);
        setData(result);
    };

    //新增
    const handleAdd = () => {
        const newData = {
            key: count.toString(),
            name: `Edward King ${count}`,
            age: 32,
            address: `London, Park Lane no. ${count}`,
            date: new Date(),
            rwzt: '1',
            ywlx: ['1', '2', '3'],
            ksmc: 'search',
            dq: ['3'],
            xb: '1',
        };
        const newsource = [...data, newData];
        setCount(count + 1);
        setData(newsource);
    };

    const pagination = {
        pageSize:5,
    }

    return (
        <div>
            <Button onClick={handleAdd} type="primary" style={{ marginBottom: 16 }}>
                Add a row
            </Button>
            <Button onClick={handleDelete} type="primary" style={{ marginBottom: 16 }}>
                删除
            </Button>
            <EditcellTable
                rowSelection={{ ...rowSelection }}
                dataSource={data}
                columns={columns}
                getChildValues={getTabledata}
                pagination={pagination}
                tableNumber={{isShow:true,title:'NO',width:150}}
            />
        </div>
    );
}
